import os

IS_DEV = os.environ['SERVER_SOFTWARE'].startswith("Dev")

if IS_DEV:
    #PAYPAL_ENDPOINT = 'https://svcs.sandbox.paypal.com/AdaptivePayments/' # sandbox
    #PAYPAL_ENDPOINT = 'https://svcs.paypal.com/AdaptivePayments/' # production
    
    #PAYPAL_PAYMENT_HOST = 'https://www.sandbox.paypal.com/au/cgi-bin/webscr' # sandbox
    PAYPAL_PAYMENT_HOST = 'https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token='
    #PAYPAL_PAYMENT_HOST = 'https://www.paypal.com/webscr' # production
    
    PAYPAL_SERVER="https://api-3t.sandbox.paypal.com/nvp"
    PAYPAL_USERID="mercha_1358303445_biz_api1.gmail.com"
    PAYPAL_PASSWORD="1358303465"
    PAYPAL_SIGNATURE="Ap3x.51bZg-dZzaqD0RY5bXwq.Q4AV0tTjblvK8Xz.QQ1KpBOLeZtC-F"
    #PAYPAL_SECURE_MERCHANT_ACCOUNT_ID="9ZDNNYCLMZCHJ"
    PAYPAL_APPLICATION_ID = 'APP-80W284485P519543T' # sandbox only
    PAYPAL_ENDPOINT=""
    PAYPAL_EMAIL=""
    PAYPAL_AUTH = "USER=%s&PWD=%s&SIGNATURE=%s" % (PAYPAL_USERID, PAYPAL_PASSWORD, PAYPAL_SIGNATURE)
    HOST="http://localhost:8080"
else:
    PAYPAL_PAYMENT_HOST = 'https://www.paypal.com/webscr?cmd=_express-checkout&token=' # production
    PAYPAL_SERVER="https://api-3t.paypal.com/nvp"
    PAYPAL_USERID="casper.32_api1.buckeyemail.osu.edu"
    PAYPAL_PASSWORD="M89263K5JANVY5K6"
    PAYPAL_SIGNATURE="Ay3sUQLjuPqkhcy0i5I1qHSAtfSOARLfa7fvNxKX1IdnyrW75wqlqvCQ"
    PAYPAL_SECURE_MERCHANT_ACCOUNT_ID="9ZDNNYCLMZCHJ"
    #PAYPAL_APPLICATION_ID = 'APP-80W284485P519543T' # sandbox only
    PAYPAL_ENDPOINT=""
    PAYPAL_EMAIL=""
    PAYPAL_AUTH = "USER=%s&PWD=%s&SIGNATURE=%s" % (PAYPAL_USERID, PAYPAL_PASSWORD, PAYPAL_SIGNATURE)
    HOST="https://oypaa-registration.appspot.com"

PAYPAL_COMMISSION = 0.2 # 20%

USE_CHAIN = False
USE_IPN = False
USE_EMBEDDED = False
SHIPPING = False # not yet working properly; PayPal bug

ADMIN_USERS = ['caspertm@gmail.com', 'kosto85@gmail.com']

# EMBEDDED_ENDPOINT = 'https://paypal.com/webapps/adaptivepayment/flow/pay'
EMBEDDED_ENDPOINT = 'https://www.sandbox.paypal.com/webapps/adaptivepayment/flow/pay'